from django.db import models
from user.models import UserProfile
from video.models import Videos
from column.models import Column


# Create your models here.
class Complaints(models.Model):
    TYPE = (
        ('1', 'video'),
        ('2', 'column'),
        ('3', 'finish'),
    )
    cplid = models.BigAutoField(primary_key=True)
    complain_text = models.CharField(max_length=200, null=True, blank=True)
    type = models.CharField(choices=TYPE, max_length=20, default='1', verbose_name='类型')
    user = models.ForeignKey(to=UserProfile, on_delete=models.CASCADE)
    video = models.ForeignKey(to=Videos, on_delete=models.CASCADE, related_name='complaint_video', null=True,
                              blank=True)
    column = models.ForeignKey(to=Column, on_delete=models.CASCADE, related_name='complaint_column', null=True,
                               blank=True)
